﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Collections;
using System.Collections.Generic;
using MediaBrowser.Library.Entities;
using System.Runtime.Serialization;
using MediaBrowserWS.Service.Enums;

namespace MediaBrowserWS.Service.Classes
{
    [DataContract]
    public class BasicCollectionItem : BasicItem
    {
        public BasicCollectionItem(BaseItem item)
        : base (item) 
        {
            Folder bob = item as Folder;
            if (bob != null)
            {
                Children = bob.Children.ToBasicEnumerable();
                Type = MediaTypes.Folder;
                UnwatchedCount = bob.UnwatchedCount;
            }
        }

        [DataMember]
        public IEnumerable<BasicItem> Children { get; set; }

        [DataMember(EmitDefaultValue=false)]
        public int UnwatchedCount { get; set; }
    }
}
